package com.amadeus.commons.log.config;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

public class AllProperties {

	private Properties properties;
	private static AllProperties _instance;

	private AllProperties() {
		try {
			properties = new Properties();
			properties.load(new FileInputStream("all.properties"));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static synchronized AllProperties getInstance() {
		if (_instance == null) {
			_instance = new AllProperties();
		}
		return _instance;
	}

	public String getProperty(String key) {
		return properties.getProperty(key);
	}

	public String getProperty(String key, String defaultValue) {
		return properties.getProperty(key, defaultValue);
	}

}
